﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyLocalChurch.Models;

namespace MyLocalChurch.ChurchServices
{
    public partial class Default : System.Web.UI.Page
    {
        private readonly MyContext _context = MyContextSingleton.Instance;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
                return;

            var churchServices = _context.ChurchServices
                .OrderBy(cs => cs.StartTime)
                .ToList();

            rptChurchServices.DataSource = churchServices;
            rptChurchServices.DataBind();
        }
    }
}